
/*
 * Sprite.cpp
 *	implementation
 *  Created on: Oct 10, 2012
 *      Author: pigmal
 */

#include "Sprite.h"
#include <conprint.h>

Sprite::Sprite()
{
	Resource = INVALID;
	TexHandle = 0;
	Body = NULL;
}

Sprite::~Sprite()
{
	Resource = INVALID;
	TexHandle = 0;
	Body = NULL;
}

//draw method
void Sprite::update()
{
	PlaneObj.Draw();
	TextureObj->Draw();

    // Disable texture and vertex arrays.
    glDisableClientState(GL_TEXTURE_COORD_ARRAY);
    glDisableClientState(GL_VERTEX_ARRAY);
}

bool Sprite::Init(PhysicsComponent *body, Texture *texture)
{
	if(/*!body ||*/ !texture)
	{
		lprintfln(" >> ERROR << Sprite::Init - wrong vals passed!");
		return false;
	}

	Body = body;
	TextureObj = texture;
}


